/*
{*******************************************************************}
{                                                                   }
{       KS-GANTT DotNet Library                                     }
{       Gantt-Charting Control for Windows Forms                    }
{                                                                   }
{       Copyright (c) 2009 - 2012 by Kroll-Software                 }
{       All Rights Reserved                                         }
{                                                                   }
{   This code is provided 'as is',                                  }
{   without warranties of any kind. Use at your own risk.           }                                                              
{                                                                   }
{   As a license holder of the KS-Gantt Control,                    }
{   you may freely redistribute executables based on                }
{   and created with these contents.                                }
{   You can modify the source code to meet your needs.              }
{                                                                   }
{   However, you must not publish, redistribute or transfer         }
{   this source code to 3rd parties under any conditions.           }
{                                                                   } 
{*******************************************************************}
*/

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using KS.Gantt;

namespace MiGuava.SqlServer
{
    public partial class ProjectNameDialog : Form
    {
        private clsProject m_Project = null;
        public clsProject Project
        {
            get
            {
                return m_Project;
            }
            set
            {
                m_Project = value;
            }
        }


        public ProjectNameDialog(clsProject project)
        {
            InitializeComponent();
            m_Project = project;

            GetValues();
        }

        private void GetValues()
        {
            txtProjectName.Text = m_Project.Text;
            txtDescription.Text = m_Project.Description;
        }

        private void SetValues()
        {
            m_Project.Text = txtProjectName.Text;
            m_Project.Description = txtDescription.Text;            
        }

        private void cmdOK_Click(object sender, EventArgs e)
        {
            if (txtProjectName.Text.Trim() == "")
            {
                Helpers.ErrMsgBox(Properties.Resources.SQLEnterProjectName);
                txtProjectName.Focus();
                return;
            }

            SetValues();

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}